package genstream.dummy

import scaladuct.{Starter, Extensible}
import genstream._

/**
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: 16.4.11
 * Time: 13:57
 * To change this template use File | Settings | File Templates.
 */

class DummyOutputResource extends OutputResource {

  def openFragmentedOutputStream(context: StreamingContext) = {
    new FragmentedOutputStream {
      def onStartFragment(metadata: Extensible) = null

      def onEndFragment() = null

      def write(b: Int) = {}
    }
  }

}

@SerialVersionUID(1L)
class DummyOutputResourceStarter extends Starter[ServiceFactory[DummyOutputResource]] {

  def newInstance(): ServiceFactory[DummyOutputResource] = new FunctionalServiceFactory(new DummyOutputResource)

  def destroy(instance: ServiceFactory[DummyOutputResource]) = null

}

